package com.tangsm.spring.mvc.mybatis.domain.entity;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;

import java.util.List;

public class Person {

    /**
     * 姓名
     */
    @NotNull//(groups = Simple.class)
    public String name;

    /**
     * 年龄
     */
    @Positive//(groups = Default.class)
    public Integer age;

    /**
     * 邮箱
     */
    @NotNull//(groups = Complex.class)
    @NotEmpty//(groups = Complex.class)
    private List<@Email String> emails;

    /**
     * Simple组
     */
    public interface Simple {

    }

    /**
     * Complex组
     */
    public interface Complex {

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public List<String> getEmails() {
        return emails;
    }

    public void setEmails(List<String> emails) {
        this.emails = emails;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", emails=" + emails +
                '}';
    }
}
